package cn.wei.sdd.core.config;

import org.springframework.context.annotation.Configuration;

import java.io.FileWriter;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: wei
 * @Date: 2021/11/04/23:00
 */
@Configuration

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118646224";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC8fhj2bFjU83/gbfs53lEjkbXB7mlK09/ouRh63M7lsq0JZFABeRZWotphqlqAQjLG6cXlZmQc3ZfHLc/GkEMa5EkQdZrbFDMEarUYJ9rnjDPsNc2HKY7tC+9LQ+HtEBy77Wpr43jU6uRhspgAuofRfDBaJs+MbyyVf2/RNEOjCc9hU/Vecl+328O5RhhvicZIUPzjHnrb9EV/pp4JNbS3h7wtu/0D8GxwlsPevvmHGNzA7889hnLhEZRvveCYPZQ2Z8X22w2ndj0jJFkrc6Af7vXP3YrRjI+YVvEM2Y5cv0fdF5ruGzwLyIbdB4FbBJzu2QWGUHrv+08ifRQqsUM5AgMBAAECggEAfdm/dwCeSwiNT95+x4NtL0+BSIuTF5fhPvQeqSG2rlye9c9ZL7KWPKAdKOph5JLObkr1i5XSsAcv6Jfoy03U0CatteSf0ThqW7+XTBqIKONOY58ErAMOX60BR4J6XRrN5Je+32wQaDCw7Z4dqRbhyfeeHQMevkgYP3THxqmbo0WrLp5u9EmDlYhmszR+Idnc+Gif7anp4mBeUmCGzozWSPNoxTjh/NczMA1irBDMBU8qsg2rmEmhw61WKmc6aquklJI0h4GwnvGkzPFEB3rfLLxN/rYs+chzDBS/ccePkuuMSTqjaF0hw5sUePjJ5a70PqBflDl9rbSn3rHqLAgugQKBgQDdB1xNsWe3vd2sc3VOFXZ5djkbM+BUeH1ZQqomcvEAPBGpYIBSxTsV+luLuK3HOzuM1sDhMW5V6/F54RNw0jo7uz4Qz0EyYhWol8gAw10q6f5NeYk2egjzt6cSy7CJkoK12uoTP6SWx5APb241cNDFOoQ16hBYfnk6FH73Hlg5UQKBgQDaUODDtpBAvou34Hvi2IonZLt+llOSPZxBrii1Hb0V8OZjERbPwQtl+FNLtEo3AV/7np3AgFwVdhNVQb2+ig0P1BR4QjOwSiHV0JzUYsgrKE+8SY0KRN24G+snbG4xX6/M6Z4wcF54eIZfCADkWL+ZfiPyS1926WH9KkBz9qVxaQKBgQDGb5NJFVr+tXFNICNSxSYmiiNe7sYaUEqJVraX6l3ATi21GTRcG0KeyrRhzp4F3oHqQevMwapDbZ7QQ2hGxBcQBV0Fjm0EJNc5E3u2Y69Dlex/9ftgc1OSK3HOCB0ohebgCfhY66yCygvmL66MQArO52hHVyrxqCqCIGCU0CN44QKBgQCo1aFtWfOnTnUJB/9nCKWXH4zssd8BmsoL9V8f6la/8CSL+rxUgOuKuYfZZR17+oE7O4iuRdZw9navGX9fKq49TntiIXiN3lbaX1HZ4mcBEVTQvWToyydY6aZrP6zcXC693vHqbgxxSGxKdAsUjRnn36h3ChlTAdw5CIL964I4+QKBgQC5riYlB43DbCbaZ4ZnfB//fMB+0WJqw0Ch7trKpG6YYRJMgXG6Xr87fc+ca+Xn+2PoUlp2jfTEOhK8U7+LBS8WZHTSukspdjEaRoSYFQgjvHBRp+aNTuMrnmRghG2XSyw1hvpG/wsbkB8cg62SrpAk3NoRyV/x9y/S6rHdQ1NqdQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoTCxmRhXxneGNT3fyuyhsd6spniWZSGxjYomSULbseWCVZgdiftJG+yJ1XS/OISSQGL240DzeMOrfM3mSpWurbfp7XMAn8kvZavcOf8jS5xCVLNyTPKizujYSRj3VsgDuXA6wfAG8Vs0YJJrrcuHwlgvgglxhguOSxj+lZP9pyplabtKNvsKBXY+xUZVwVRvExDVccqyz8S5SNAU2qCgovjG6TYWDDtVqOqawpc2Zl92qmc3YjnfcbBqGyBm49FfSo5/kgHSMPQ9trALFf5q+urUpfL/1bGEKNwzlnt0vvw2r58tT2Y60xP8o0iseBmIAcqBS3VdU1a5NfBE7465FQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问，
    public static String notify_url = "http://2c780820s4.wicp.vip/admin/core/pay/notify_url.view";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://2c780820s4.wicp.vip/admin/core/pay/return_url.view";


    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志
    public static String log_path = "D:\\bishe";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
